Optimal. Leaf size=99 \[ -\frac {4 i c^3 (a+i a \tan (e+f x))^m}{f m}+\frac {4 i c^3 (a+i a \tan (e+f x))^{1+m}}{a f (1+m)}-\frac {i c^3 (a+i a \tan (e+f x))^{2+m}}{a^2 f (2+m)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 99, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.097, Rules used = {3603, 3568, 45}
\begin {gather*} -\frac {i c^3 (a+i a \tan (e+f x))^{m+2}}{a^2 f (m+2)}-\frac {4 i c^3 (a+i a \tan (e+f x))^m}{f m}+\frac {4 i c^3 (a+i a \tan (e+f x))^{m+1}}{a f (m+1)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 45
Rule 3568
Rule 3603
Rubi steps
\begin {align*} \int (a+i a \tan (e+f x))^m (c-i c \tan (e+f x))^3 \, dx &=\left (a^3 c^3\right ) \int \sec ^6(e+f x) (a+i a \tan (e+f x))^{-3+m} \, dx\\ &=-\frac {\left (i c^3\right ) \text {Subst}\left (\int (a-x)^2 (a+x)^{-1+m} \, dx,x,i a \tan (e+f x)\right )}{a^2 f}\\ &=-\frac {\left (i c^3\right ) \text {Subst}\left (\int \left (4 a^2 (a+x)^{-1+m}-4 a (a+x)^m+(a+x)^{1+m}\right ) \, dx,x,i a \tan (e+f x)\right )}{a^2 f}\\ &=-\frac {4 i c^3 (a+i a \tan (e+f x))^m}{f m}+\frac {4 i c^3 (a+i a \tan (e+f x))^{1+m}}{a f (1+m)}-\frac {i c^3 (a+i a \tan (e+f x))^{2+m}}{a^2 f (2+m)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 14.76, size = 161, normalized size = 1.63 \begin {gather*} -\frac {i 2^{2+m} c^3 \left (e^{i f x}\right )^m \left (\frac {e^{i (e+f x)}}{1+e^{2 i (e+f x)}}\right )^m \left (2+2 e^{4 i (e+f x)}+3 m+m^2+2 e^{2 i (e+f x)} (2+m)\right ) \sec ^{-m}(e+f x) (\cos (f x)+i \sin (f x))^{-m} (a+i a \tan (e+f x))^m}{\left (1+e^{2 i (e+f x)}\right )^2 f m (1+m) (2+m)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 1.21, size = 129, normalized size = 1.30
method | result | size |
norman | \(\frac {i c^{3} \left (\tan ^{2}\left (f x +e \right )\right ) {\mathrm e}^{m \ln \left (a +i a \tan \left (f x +e \right )\right )}}{f \left (2+m \right )}-\frac {2 c^{3} \left (3+m \right ) \tan \left (f x +e \right ) {\mathrm e}^{m \ln \left (a +i a \tan \left (f x +e \right )\right )}}{f \left (1+m \right ) \left (2+m \right )}-\frac {i c^{3} \left (m^{2}+5 m +8\right ) {\mathrm e}^{m \ln \left (a +i a \tan \left (f x +e \right )\right )}}{f m \left (1+m \right ) \left (2+m \right )}\) | \(129\) |
risch | \(\text {Expression too large to display}\) | \(3221\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 1.03, size = 163, normalized size = 1.65 \begin {gather*} -\frac {4 \, {\left (i \, c^{3} m^{2} + 3 i \, c^{3} m + 2 i \, c^{3} e^{\left (4 i \, f x + 4 i \, e\right )} + 2 i \, c^{3} + 2 \, {\left (i \, c^{3} m + 2 i \, c^{3}\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} \left (\frac {2 \, a e^{\left (2 i \, f x + 2 i \, e\right )}}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}\right )^{m}}{f m^{3} + 3 \, f m^{2} + 2 \, f m + {\left (f m^{3} + 3 \, f m^{2} + 2 \, f m\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + 2 \, {\left (f m^{3} + 3 \, f m^{2} + 2 \, f m\right )} e^{\left (2 i \, f x + 2 i \, e\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 979 vs. \(2 (80) = 160\).
time = 0.87, size = 979, normalized size = 9.89 \begin {gather*} \begin {cases} x \left (i a \tan {\left (e \right )} + a\right )^{m} \left (- i c \tan {\left (e \right )} + c\right )^{3} & \text {for}\: f = 0 \\\frac {2 c^{3} f x \tan ^{2}{\left (e + f x \right )}}{2 a^{2} f \tan ^{2}{\left (e + f x \right )} - 4 i a^{2} f \tan {\left (e + f x \right )} - 2 a^{2} f} - \frac {4 i c^{3} f x \tan {\left (e + f x \right )}}{2 a^{2} f \tan ^{2}{\left (e + f x \right )} - 4 i a^{2} f \tan {\left (e + f x \right )} - 2 a^{2} f} - \frac {2 c^{3} f x}{2 a^{2} f \tan ^{2}{\left (e + f x \right )} - 4 i a^{2} f \tan {\left (e + f x \right )} - 2 a^{2} f} - \frac {i c^{3} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )} \tan ^{2}{\left (e + f x \right )}}{2 a^{2} f \tan ^{2}{\left (e + f x \right )} - 4 i a^{2} f \tan {\left (e + f x \right )} - 2 a^{2} f} - \frac {2 c^{3} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )} \tan {\left (e + f x \right )}}{2 a^{2} f \tan ^{2}{\left (e + f x \right )} - 4 i a^{2} f \tan {\left (e + f x \right )} - 2 a^{2} f} + \frac {i c^{3} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 a^{2} f \tan ^{2}{\left (e + f x \right )} - 4 i a^{2} f \tan {\left (e + f x \right )} - 2 a^{2} f} - \frac {8 c^{3} \tan {\left (e + f x \right )}}{2 a^{2} f \tan ^{2}{\left (e + f x \right )} - 4 i a^{2} f \tan {\left (e + f x \right )} - 2 a^{2} f} + \frac {4 i c^{3}}{2 a^{2} f \tan ^{2}{\left (e + f x \right )} - 4 i a^{2} f \tan {\left (e + f x \right )} - 2 a^{2} f} & \text {for}\: m = -2 \\- \frac {4 c^{3} f x \tan {\left (e + f x \right )}}{a f \tan {\left (e + f x \right )} - i a f} + \frac {4 i c^{3} f x}{a f \tan {\left (e + f x \right )} - i a f} + \frac {2 i c^{3} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )} \tan {\left (e + f x \right )}}{a f \tan {\left (e + f x \right )} - i a f} + \frac {2 c^{3} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{a f \tan {\left (e + f x \right )} - i a f} + \frac {c^{3} \tan ^{2}{\left (e + f x \right )}}{a f \tan {\left (e + f x \right )} - i a f} + \frac {5 c^{3}}{a f \tan {\left (e + f x \right )} - i a f} & \text {for}\: m = -1 \\4 c^{3} x - \frac {2 i c^{3} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{f} + \frac {i c^{3} \tan ^{2}{\left (e + f x \right )}}{2 f} - \frac {3 c^{3} \tan {\left (e + f x \right )}}{f} & \text {for}\: m = 0 \\\frac {i c^{3} m^{2} \left (i a \tan {\left (e + f x \right )} + a\right )^{m} \tan ^{2}{\left (e + f x \right )}}{f m^{3} + 3 f m^{2} + 2 f m} - \frac {2 c^{3} m^{2} \left (i a \tan {\left (e + f x \right )} + a\right )^{m} \tan {\left (e + f x \right )}}{f m^{3} + 3 f m^{2} + 2 f m} - \frac {i c^{3} m^{2} \left (i a \tan {\left (e + f x \right )} + a\right )^{m}}{f m^{3} + 3 f m^{2} + 2 f m} + \frac {i c^{3} m \left (i a \tan {\left (e + f x \right )} + a\right )^{m} \tan ^{2}{\left (e + f x \right )}}{f m^{3} + 3 f m^{2} + 2 f m} - \frac {6 c^{3} m \left (i a \tan {\left (e + f x \right )} + a\right )^{m} \tan {\left (e + f x \right )}}{f m^{3} + 3 f m^{2} + 2 f m} - \frac {5 i c^{3} m \left (i a \tan {\left (e + f x \right )} + a\right )^{m}}{f m^{3} + 3 f m^{2} + 2 f m} - \frac {8 i c^{3} \left (i a \tan {\left (e + f x \right )} + a\right )^{m}}{f m^{3} + 3 f m^{2} + 2 f m} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.36, size = 229, normalized size = 2.31 \begin {gather*} -\frac {2\,c^3\,{\left (\frac {a\,\left (\cos \left (2\,e+2\,f\,x\right )+1+\sin \left (2\,e+2\,f\,x\right )\,1{}\mathrm {i}\right )}{\cos \left (2\,e+2\,f\,x\right )+1}\right )}^m\,\left (m\,7{}\mathrm {i}+\cos \left (2\,e+2\,f\,x\right )\,16{}\mathrm {i}+\cos \left (4\,e+4\,f\,x\right )\,4{}\mathrm {i}+2\,m^2\,\sin \left (2\,e+2\,f\,x\right )+m^2\,\sin \left (4\,e+4\,f\,x\right )+m\,\cos \left (2\,e+2\,f\,x\right )\,10{}\mathrm {i}+m\,\cos \left (4\,e+4\,f\,x\right )\,3{}\mathrm {i}+6\,m\,\sin \left (2\,e+2\,f\,x\right )+3\,m\,\sin \left (4\,e+4\,f\,x\right )+m^2\,1{}\mathrm {i}+m^2\,\cos \left (2\,e+2\,f\,x\right )\,2{}\mathrm {i}+m^2\,\cos \left (4\,e+4\,f\,x\right )\,1{}\mathrm {i}+12{}\mathrm {i}\right )}{f\,m\,\left (4\,\cos \left (2\,e+2\,f\,x\right )+\cos \left (4\,e+4\,f\,x\right )+3\right )\,\left (m^2+3\,m+2\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________